﻿using System;
using System.Runtime.Serialization;

namespace Flagwind.Plugins
{
	[Serializable]
	public class PluginFileException : PluginException
	{
		#region 构造方法

		public PluginFileException(string message) : base(message)
		{
		}

		public PluginFileException(string fileName, string message) : base(message, null)
		{
			this.FileName = fileName;
		}

		public PluginFileException(string fileName, string message, Exception innerException) : base(message, innerException)
		{
			this.FileName = fileName;
		}

		protected PluginFileException(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			this.FileName = info.GetString("FileName");
		}

		#endregion

		#region 公共属性

		public string FileName
		{
			get;
			private set;
		}

		#endregion

		#region 重写方法

		public override void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			base.GetObjectData(info, context);

			info.AddValue("FileName", this.FileName);
		}

		#endregion
	}
}